// 封装新鲜好物业务逻辑
import { getNewAPI } from '@/apis/home.js'
import { onMounted, ref } from 'vue'

export function useNew() {
  // 获取新鲜好物列表
  const newList = ref([])
  const getNewList = async () => {
    const res = await getNewAPI()
    newList.value = res.result
  }
  onMounted(() => getNewList())

  return {
    newList
  }
}
